home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / hidetbar / hidetbar.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-12-31  |  1.9 KB  |  59 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Hide/Show Taskbar"
  4.    ClientHeight    =   720
  5.    ClientLeft      =   2610
  6.    ClientTop       =   3480
  7.    ClientWidth     =   4125
  8.    Height          =   1125
  9.    Left            =   2550
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   720
  12.    ScaleWidth      =   4125
  13.    Top             =   3135
  14.    Width           =   4245
  15.    Begin VB.CommandButton Command3 
  16.       Caption         =   "Close"
  17.       Height          =   495
  18.       Left            =   2760
  19.       TabIndex        =   2
  20.       Top             =   120
  21.       Width           =   1215
  22.    End
  23.    Begin VB.CommandButton Command2 
  24.       Caption         =   "Show"
  25.       Height          =   495
  26.       Left            =   1440
  27.       TabIndex        =   1
  28.       Top             =   120
  29.       Width           =   1215
  30.    End
  31.    Begin VB.CommandButton Command1 
  32.       Caption         =   "Hide"
  33.       Height          =   495
  34.       Left            =   120
  35.       TabIndex        =   0
  36.       Top             =   120
  37.       Width           =   1215
  38.    End
  39. Attribute VB_Name = "Form1"
  40. Attribute VB_Creatable = False
  41. Attribute VB_Exposed = False
  42. Option Explicit
  43. Dim hwnd1 As Long
  44. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  45. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  46. Const SWP_HIDEWINDOW = &H80
  47. Const SWP_SHOWWINDOW = &H40
  48. Private Sub Command1_Click()
  49. hwnd1 = FindWindow("Shell_traywnd", "")
  50. Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
  51. End Sub
  52. Private Sub Command2_Click()
  53. Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
  54. End Sub
  55. Private Sub Command3_Click()
  56.     Set Form1 = Nothing
  57.     End
  58. End Sub
  59.